﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ModulesInfrastructure;
using ShellInfrastructure;
using ModuleOrderItem.View;
using Microsoft.Practices.Unity;
using Microsoft.Practices.Prism.Regions;
using ModuleOrderItem.ViewModel;

namespace ModuleOrderItem
{
    public class OrderItemModule : ModulesInfrastructure.SharedModule
    {
        /// <summary>
        /// Registrates views in the region
        /// </summary>
        protected override void RegisterViewsInRegions()
        {
            RegionManager.RegisterViewWithRegion(RegionNames.RightRegionName, () => UnityContainer.Resolve<IOrderViewItem>());
        }


        /// <summary>
        /// Registrates types 
        /// </summary>
        protected override void RegisterTypesDependencies()
        {
            UnityContainer.RegisterType<IOrderViewItem, OrderViewItem>(new ContainerControlledLifetimeManager());
            UnityContainer.RegisterType<IOrderItemViewModel, OrderItemViewModel>(new ContainerControlledLifetimeManager());
        }
    }
}
